package com.mgm.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.mgm.dto.AffsettingsDto;
import com.mgm.dto.AffsettingsForClickDto;
import com.mgm.dto.offer.OfferRoot;
import com.mgm.pojo.Affsettings;
import com.mgm.pojo.AffsettingsExample;

public interface AffsettingsMapper {
	
    long countByExample(AffsettingsExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Affsettings record);

    int insertSelective(Affsettings record);

    List<Affsettings> selectByExample(AffsettingsExample example);

    Affsettings selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Affsettings record);

    int updateByPrimaryKey(Affsettings record);
    
    List<AffsettingsDto> selectByParames(AffsettingsDto affsettingsDto);
    
    //click入库时使用 affid+offerId 查找相关信息
    AffsettingsForClickDto selectByAffIdAndOfferId(String affId, String offerId);
    
    //根据渠道id和广告id获取 Offer-渠道
    Affsettings selectByAffIdAndAdmentId(@Param("affId")Integer affId, @Param("admentId")Integer admentId);
    
    //根据渠道id和广告id获取 Offer-渠道
    Affsettings selectByAffIdStrAndAdmentIdStr(@Param("affid")String affid, @Param("offerid")String admentid);
    
    //调用存储过程
    void insertCallAffsetting();
    
    //下发渠道offer
    List<OfferRoot> getAffOffer(Map<String, String> map);
}